//////////////////////////////////////////////////////////////
///														   ///
///				  Freezebot	in hand		       			   ///
///				  								   		   ///
//////////////////////////////////////////////////////////////

//Freezebot projectile
Actor FreezebotInactive
{
Radius 8
Height 5
Mass 1000000
Health 20
Damage 0
Damagetype ice
SeeSound "BEP"
DONTHURTSHOOTER
Speed 30
+NOBLOOD
-SHOOTABLE
+MISSILE
+DOOMBOUNCE
+BOUNCEONFLOORS
+BOUNCEONWALLS
+BOUNCEONCEILINGS
BounceFactor 0.5
+THRUSPECIES
+THRUGHOST
	States
	{
	Spawn:
		FZBL A 0 A_Gravity
		FZBL AAA 4
		Loop
	Death:
		FZBL A 0 A_ChangeVelocity(0 ,0 ,10)
		FZBL AA 4 A_Playsound("CELPIK")
		TNT1 AAAA 0 A_SpawnItemEx("MiniCryoSmoke1", 0, 0, -5, random(10, 30)*0.1, 0, random(0, 10)*0.1, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, 10)*0.1, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_SpawnItemEx("Freezebot",0,0,0,0,0,0,0,288)
		Stop
	}
}
//Freezebot weapon
ACTOR HandFreezebot : BrutalWeapon
{
	Weapon.AmmoUse1 1
	Weapon.AmmoGive1 0
	Weapon.SelectionOrder 99999
	Weapon.AmmoType1 "FreezebotAmmo"
	Weapon.PreferredSkin "Fist Marine"
	Obituary "%o was frozen by %k's Freezebot."
    AttackSound "None"
    Inventory.PickupSound "AmmoAPIN"
	Inventory.Pickupmessage "You got a Freezebot! (Slot 9)"
	Inventory.ForbiddenTo Sorcerer, Paladin, Corvus
    +WEAPON.NOAUTOAIM
    +WEAPON.NOALERT
	+WEAPON.NOAUTOFIRE
	//+INVENTORY.UNDROPPABLE
    Scale 0.3
	States
	{
	altfire: //coz there is no altfire
	Ready:
	ReadyLoop:
	Ready3:
	    TNT1 A 0
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_JumpIfInventory("FreezebotAmmo", 1, 1)
		
		Goto NoGrenades
		FZBW AB 1
		Goto Steady
		
	Steady:
		FZBW B 1 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		Loop
	
	NoGrenades:
		TNT1 A 1 A_WeaponReady
		Goto Ready
	
	Deselect:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("FiredGrenade", 1, "DropGrenade")
		TNT1 A 1 A_Lower
		Wait
	
	DropGrenade:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("FiredGrenade", 1)
		TNT1 A 0 A_FireCustomMissile("FreezebotInactive", random(-2,2), 1, 0, 0, 0, 0)
		Goto Deselect
		
	Select:
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
		FZBW A 1 A_Raise
		Wait
	Fire:
	    FZBW BBBCCCDDDEEEFFF 1
		TNT1 A 0 A_PlaySound ("BEP")
		TNT1 A 0 A_GiveInventory("FiredGrenade", 1)
		FZBW GGGGGHHHHHHIIJJKK 1
		
	Hold:
	    TNT1 A 1
		TNT1 A 1 A_Refire
		TNT1 A 0 A_PlaySound ("BEP")
		FZBW KKLLLMMM 1
		TNT1 A 0 A_FireCustomMissile("FreezebotInactive", random(-2,2), 1, 0, 0, 0, 0)
	    TNT1 A 0 A_TakeInventory("FiredGrenade", 1)
		FZBW NNOO 1
		TNT1 A 3 
		Goto Ready
	
 	Spawn:
		FZBL A -1
		Stop		
	}
}


Actor FreezebotAmmo : Ammo
{
Radius 10
Inventory.Amount 1
Inventory.MaxAmount 1
Ammo.BackpackAmount 0
Ammo.BackpackMaxAmount 2
Inventory.PickupMessage "Picked up a Freezebot ! (slot 9)"
Inventory.Icon ""
Inventory.PickupSound "GRNPIN"
Scale 0.9
States
{
Spawn:
	FZBL A 2 A_SpawnItemEx("FreezerTrailSparksSmall", 0, 0, -5, random(10, 30)*0.1, 0, random(0, 10)*0.1, random(-1,-360), SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	FZBL A 10
	Loop
}
}